/* 性能优化 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    height: 100%;
    /* GPU加速 */
    transform: translateZ(0);
    /* 平滑滚动 */
    scroll-behavior: smooth;
    /* 减少重排重绘 */
    backface-visibility: hidden;
    /* 字体渲染优化 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* CSS Containment 优化 */
    contain: layout style paint;
    /* 触摸优化 */
    touch-action: manipulation;
    /* 优化渲染性能 */
    perspective: 1000px;
    /* 减少字体渲染开销 */
    text-rendering: optimizeSpeed;
}

/* GPU加速优化 */
.site-card,
.news-card,
.tool-item,
.ai-tool-card,
.academic-tool-card,
.learning-card,
.dev-tool-card,
.productivity-card {
    transform: translateZ(0);
    will-change: transform;
}

/* 减少重排重绘 */
.sidebar-toggle,
.sidebar-collapse-btn {
    contain: layout style paint;
}

/* 滚动性能优化 */
.sites-grid,
.news-grid,
.main-content {
    /* 启用硬件加速 */
    transform: translateZ(0);
    /* 优化滚动性能 */
    -webkit-overflow-scrolling: touch;
    /* CSS Containment */
    contain: layout style paint;
    /* 减少重绘 */
    will-change: scroll-position;
}

/* 骨架屏加载动画 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 懒加载图片样式 */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.lazy.loaded {
    opacity: 1;
}

/* 图片占位符 */
.image-placeholder {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    min-height: 100px;
}

/* 关键CSS内联优化 - 首屏样式 */
.critical-above-fold {
    /* 确保首屏内容快速渲染 */
    contain: layout style paint;
    will-change: auto;
}

/* 减少重排重绘的优化 */
.layout-stable {
    contain: layout;
    transform: translateZ(0);
}

/* 字体加载优化 */
@font-face {
    font-family: 'system-ui';
    src: local('system-ui'), local('-apple-system'), local('BlinkMacSystemFont');
    font-display: swap;
}

/* 预加载关键资源 */
.preload-critical {
    content-visibility: auto;
    contain-intrinsic-size: 200px;
}

/* 动画效果 - 性能优化 */
@keyframes fadeIn {
    from { opacity: 0; transform: translate3d(0, 20px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes slideIn {
    from { transform: translate3d(-100%, 0, 0); }
    to { transform: translate3d(0, 0, 0); }
}

@keyframes pulse {
    0%, 100% { transform: scale3d(1, 1, 1); }
    50% { transform: scale3d(1.05, 1.05, 1); }
}

@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

/* 动画性能优化类 */
.animate-optimized {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.animate-optimized:not(:hover):not(:focus) {
    will-change: auto;
}

.skeleton-card {
    width: 100%;
    height: 120px;
    margin-bottom: 16px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

.skeleton-text.long {
    width: 100%;
}

/* 渐进式图片加载 */
.progressive-image {
    position: relative;
    overflow: hidden;
}

.progressive-image img {
    transition: opacity 0.3s ease;
}

.progressive-image .low-quality {
    filter: blur(5px);
    transform: scale(1.05);
}

.progressive-image .high-quality {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

.progressive-image .high-quality.loaded {
    opacity: 1;
}

/* 加载状态指示器 */
.loading-indicator {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0078d4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 性能优化提示 */
.performance-tip {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 120, 212, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.performance-tip.show {
    transform: translateX(0);
}

.performance-tip .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    margin-left: 8px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(-45deg, #0a0a0a, #1a1a2e, #16213e, #0f3460, #533483);
    background-size: 400% 400%;
    animation: sciFiGradient 20s ease infinite;
    color: #333;
    overflow-x: hidden;
    position: relative;
    margin: 0;
    padding: 0;
}

/* 自定义背景样式 */
body.custom-background {
    background-image: var(--custom-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

body.custom-background::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(-45deg, #0078d4, #106ebe, #005a9e, #004578);
    opacity: var(--bg-opacity, 0.7);
    z-index: -1;
    pointer-events: none;
}

/* 科幻动态背景动画 */
@keyframes sciFiGradient {
    0% {
        background-position: 0% 50%;
        filter: hue-rotate(0deg);
    }
    25% {
        background-position: 100% 50%;
        filter: hue-rotate(90deg);
    }
    50% {
        background-position: 100% 100%;
        filter: hue-rotate(180deg);
    }
    75% {
        background-position: 0% 100%;
        filter: hue-rotate(270deg);
    }
    100% {
        background-position: 0% 50%;
        filter: hue-rotate(360deg);
    }
}

/* 科幻粒子动画 */
@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.7;
    }
}

@keyframes neonPulse {
    0%, 100% {
        box-shadow: 0 0 5px #00ffff, 0 0 10px #00ffff, 0 0 15px #00ffff;
    }
    50% {
        box-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff, 0 0 30px #ff00ff;
    }
}

/* 科幻背景装饰元素 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><defs><pattern id="sciFiGrid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="%2300ffff" stroke-width="0.5" opacity="0.3"/><circle cx="20" cy="20" r="1" fill="%2300ffff" opacity="0.6"><animate attributeName="opacity" values="0.6;1;0.6" dur="3s" repeatCount="indefinite"/></circle></pattern><pattern id="sciFiParticles" width="80" height="80" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="0.5" fill="%23ff00ff" opacity="0.8"><animate attributeName="cy" values="10;70;10" dur="8s" repeatCount="indefinite"/></circle><circle cx="60" cy="30" r="0.8" fill="%2300ffff" opacity="0.6"><animate attributeName="cx" values="60;20;60" dur="6s" repeatCount="indefinite"/></circle><circle cx="40" cy="60" r="0.3" fill="%23ffff00" opacity="0.9"><animate attributeName="r" values="0.3;1;0.3" dur="4s" repeatCount="indefinite"/></circle></pattern></defs><rect width="200" height="200" fill="url(%23sciFiGrid)"/><rect width="200" height="200" fill="url(%23sciFiParticles)"/></svg>') repeat;
    pointer-events: none;
    z-index: -1;
    animation: particleFloat 10s ease-in-out infinite;
}

/* 科幻光效叠加层 */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(0, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 0, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(255, 255, 0, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: neonPulse 8s ease-in-out infinite;
}

/* 侧边栏样式 */
.left-sidebar, .right-sidebar {
    width: 250px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px;
    box-sizing: border-box;
    position: fixed;
    top: 0;
    z-index: 100;
    overflow: hidden;
    transition: all 0.3s ease;
}

.left-sidebar {
    left: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateX(0);
}

.right-sidebar {
    right: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateX(0);
}

/* 缩进状态 */
.left-sidebar.collapsed {
    transform: translateX(-220px);
    width: 50px;
    padding: 20px 10px;
}

.right-sidebar.collapsed {
    transform: translateX(220px);
    width: 50px;
    padding: 20px 10px;
}

/* 缩进时隐藏文字内容 */
.left-sidebar.collapsed .sidebar-section h3,
.left-sidebar.collapsed .tool-name,
.left-sidebar.collapsed .tool-item span:last-child,
.left-sidebar.collapsed .custom-item label,
.left-sidebar.collapsed .custom-item input,
.left-sidebar.collapsed .custom-item button,
.left-sidebar.collapsed .bookmark-item span:last-child,
.left-sidebar.collapsed .add-bookmark-btn,
.right-sidebar.collapsed .sidebar-section h3,
.right-sidebar.collapsed .tool-name,
.right-sidebar.collapsed .tool-item span:last-child,
.right-sidebar.collapsed .custom-item label,
.right-sidebar.collapsed .custom-item input,
.right-sidebar.collapsed .custom-item button,
.right-sidebar.collapsed .bookmark-item span:last-child,
.right-sidebar.collapsed .add-bookmark-btn {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* 缩进时调整图标布局 */
.left-sidebar.collapsed .ai-tool-card,
.right-sidebar.collapsed .ai-tool-card {
    flex-direction: column;
    align-items: center;
    padding: 8px;
    margin-bottom: 8px;
}

.left-sidebar.collapsed .tool-item,
.right-sidebar.collapsed .tool-item,
.left-sidebar.collapsed .bookmark-item,
.right-sidebar.collapsed .bookmark-item {
    justify-content: center;
    padding: 8px;
    margin-bottom: 8px;
}

.left-sidebar.collapsed .tool-icon,
.right-sidebar.collapsed .tool-icon,
.left-sidebar.collapsed .bookmark-icon,
.right-sidebar.collapsed .bookmark-icon {
    margin-right: 0;
}

.sidebar-section {
    margin-bottom: 30px;
}

.sidebar-section h3 {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* AI工具卡片 */
.ai-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ai-tool-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.ai-tool-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 25px rgba(0, 120, 212, 0.2);
}

.ai-tool-card .tool-icon {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.ai-tool-card .tool-name {
    font-size: 12px;
    color: #323130;
    font-weight: 500;
}

/* 快捷工具 */
.quick-tools {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tool-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

.tool-item .tool-icon {
    font-size: 16px;
}

/* 个性化面板 */
.customization-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.custom-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.custom-item label {
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.custom-item input[type="file"] {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 8px;
    color: white;
    font-size: 12px;
}

.custom-item input[type="range"] {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    -webkit-appearance: none;
}

.custom-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0078d4;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.reset-bg-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

.reset-bg-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 书签面板 */
.bookmarks-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bookmark-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.bookmark-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

.bookmark-icon {
    font-size: 14px;
}

.add-bookmark-btn {
    background: rgba(0, 120, 212, 0.8);
    border: 1px solid rgba(0, 120, 212, 0.6);
    border-radius: 6px;
    padding: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    margin-top: 8px;
}

.add-bookmark-btn:hover {
    background: rgba(0, 120, 212, 1);
    transform: translateY(-1px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/* 网页标题样式 */
.page-title {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.page-title h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    letter-spacing: 2px;
    position: relative;
}

.page-title h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* 搜索栏样式 */
.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    margin-top: 60px;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.search-input {
    width: 100%;
    padding: 14px 20px 14px 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    color: #323130;
    /* 输入性能优化 */
    will-change: transform, opacity;
    contain: layout style;
    /* 移动端优化 */
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.search-input::placeholder {
    color: #605e5c;
    font-weight: 400;
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: #0078d4;
    box-shadow: 0 8px 30px rgba(0, 120, 212, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.search-input:hover:not(:focus) {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(255, 255, 255, 0.3);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #0078d4;
    z-index: 1;
    transition: color 0.3s ease;
}

.search-box:hover .search-icon {
    color: #106ebe;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* 快速访问样式 */
.quick-access {
    margin-bottom: 40px;
}

.quick-access h2 {
    color: white;
    margin-bottom: 20px;
    font-weight: 300;
    font-size: 24px;
}

.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
    max-width: 800px;
}

.site-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    text-decoration: none;
    color: #323130;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.site-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.site-card:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 120, 212, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 120, 212, 0.2);
}

.site-card:hover::before {
    left: 100%;
}

.site-card:active {
    transform: translateY(-1px) scale(1.01);
}

.site-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: linear-gradient(135deg, #0078d4, #106ebe);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-card:hover .site-icon {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.4);
}

.site-name {
    font-size: 14px;
    font-weight: 500;
    margin-top: 8px;
}

/* 新闻部分样式 */
.news-section {
    margin-bottom: 40px;
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.news-header h2 {
    color: white;
    font-weight: 300;
    font-size: 24px;
}

.news-controls {
    display: flex;
    gap: 10px;
}

.refresh-btn, .settings-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.refresh-btn:hover, .settings-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.news-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    cursor: pointer;
}

.news-card:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 25px rgba(0, 120, 212, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 120, 212, 0.2);
}

.news-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.news-content {
    padding: 20px;
}

.news-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    color: #333;
}

.news-summary {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 12px;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
}

/* 天气小部件样式 */
.weather-widget {
    position: fixed;
    top: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    min-width: 120px;
    z-index: 50; /* 确保在合适的层级 */
}

.weather-widget:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 120, 212, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 120, 212, 0.2);
}

/* 天气定位设置 */
.weather-location {
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 6px;
}

.weather-location:hover {
    background: rgba(255, 255, 255, 0.2);
}

.location-settings {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    margin-top: 8px;
}

.location-settings.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.location-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.location-btn {
    background: #0078d4;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.location-btn:hover {
    background: #106ebe;
    transform: translateY(-1px);
}

.manual-location {
    display: flex;
    gap: 8px;
    align-items: center;
}

.manual-location input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid rgba(0, 120, 212, 0.3);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.manual-location input:focus {
    border-color: #0078d4;
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.2);
}

.set-location-btn {
    background: #0078d4;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    white-space: nowrap;
}

.set-location-btn:hover {
    background: #106ebe;
}

/* 城市建议样式 */
.city-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid rgba(0, 120, 212, 0.3);
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.city-suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    font-size: 14px;
    color: #333;
}

.city-suggestion-item:hover,
.city-suggestion-item.highlighted {
    background-color: #f8f9fa;
}

.city-suggestion-item:last-child {
    border-bottom: none;
}

.manual-location {
    position: relative;
}

.weather-info {
    text-align: center;
}

.weather-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.weather-temp {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.weather-location {
    font-size: 14px;
    color: #666;
}

/* 设置面板样式 */
.settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.settings-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.settings-content h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
}

.setting-item {
    margin-bottom: 15px;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
}

.setting-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.setting-item select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.close-settings {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 20px;
    width: 100%;
    transition: all 0.3s ease;
}

.close-settings:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .search-container {
        margin-top: 30px;
        margin-bottom: 30px;
    }
    
    .sites-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 15px;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .weather-widget {
        position: static;
        margin-bottom: 20px;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }
    
    .quick-access h2,
    .news-header h2 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .sites-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .site-card {
        padding: 15px;
    }
    
    .site-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .site-name {
        font-size: 12px;
    }
}

/* 深色主题 */
body.dark-theme {
    background: linear-gradient(-45deg, #1e1e1e, #2d2d30, #252526, #1e1e1e);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

.dark-theme .search-input {
    background: rgba(45, 45, 48, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.dark-theme .search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.dark-theme .search-input:focus {
    background: rgba(45, 45, 48, 0.95);
    border-color: #0078d4;
}

.dark-theme .search-input:hover:not(:focus) {
    background: rgba(45, 45, 48, 0.92);
    border-color: rgba(255, 255, 255, 0.2);
}

.dark-theme .site-card,
.dark-theme .news-card,
.dark-theme .weather-widget {
    background: rgba(45, 45, 48, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.dark-theme .site-card:hover,
.dark-theme .news-card:hover,
.dark-theme .weather-widget:hover {
    background: rgba(45, 45, 48, 0.95);
    border-color: rgba(0, 120, 212, 0.3);
}

.dark-theme .news-title {
    color: #ffffff;
}

.dark-theme .news-summary {
    color: rgba(255, 255, 255, 0.8);
}

.dark-theme .news-meta {
    color: rgba(255, 255, 255, 0.6);
}

.dark-theme .search-icon {
    color: #0078d4;
}

.dark-theme .search-box:hover .search-icon {
    color: #106ebe;
}

/* 响应式设计 */
@media (max-width: 1400px) {
    .left-sidebar, .right-sidebar {
        width: 200px;
    }
    
    /* 中等屏幕时调整body padding */
    body {
        padding-left: 200px;
        padding-right: 200px;
    }
    
    /* 中等屏幕时侧边栏缩进状态的调整 */
    body.left-sidebar-collapsed {
        padding-left: 40px;
    }
    
    body.right-sidebar-collapsed {
        padding-right: 40px;
    }
    
    body.left-sidebar-collapsed.right-sidebar-collapsed {
        padding-left: 40px;
        padding-right: 40px;
    }
    
    .weather-widget {
        right: 220px; /* 适配较小的侧边栏宽度 */
    }
    
    body.right-sidebar-collapsed .weather-widget {
        right: 60px;
    }
}

@media (max-width: 1200px) {
    .left-sidebar, .right-sidebar {
        transform: translateX(-100%);
    }
    
    .left-sidebar.show {
        transform: translateX(0);
    }
    
    .right-sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: block;
        position: fixed;
        top: 20px;
        z-index: 1001;
        background: rgba(255, 255, 255, 0.9);
        border: none;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        cursor: pointer;
        backdrop-filter: blur(10px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .sidebar-toggle.left {
        left: 20px;
    }
    
    .sidebar-toggle.right {
        right: 20px;
    }
    
    .sidebar-collapse-btn {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        margin-right: 0;
        padding: 20px;
    }
    
    .container {
        margin-top: 80px;
    }
    
    .search-container {
        margin-top: 40px;
    }
    
    .weather-widget {
        position: relative;
        top: auto;
        right: auto;
        margin: 20px auto;
        display: block;
        width: fit-content;
    }
    
    .right-sidebar-visible .weather-widget {
        right: auto; /* 移动端取消固定定位调整 */
    }
}

@media (max-width: 768px) {
    .ai-tools {
        grid-template-columns: 1fr;
    }
    
    .sites-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 15px;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .search-container {
        margin-top: 40px;
    }
    
    .weather-widget {
        position: relative;
        top: auto;
        right: auto;
        margin: 20px auto;
        display: block;
        width: fit-content;
    }
    
    .right-sidebar-visible .weather-widget {
        right: auto; /* 移动端取消固定定位调整 */
    }
}

/* 侧边栏显示状态 */
.left-sidebar-visible .left-sidebar {
    transform: translateX(0);
}

.right-sidebar-visible .right-sidebar {
    transform: translateX(0);
}

/* 主内容区域布局 */
.main-content {
    margin-left: 250px;
    margin-right: 250px;
    transition: margin 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

/* 当左侧边栏缩进时 */
body.left-sidebar-collapsed .main-content {
    margin-left: 50px;
}

/* 当右侧边栏缩进时 */
body.right-sidebar-collapsed .main-content {
    margin-right: 50px;
}

/* 当两个侧边栏都缩进时 */
body.left-sidebar-collapsed.right-sidebar-collapsed .main-content {
    margin-left: 50px;
    margin-right: 50px;
}

/* 天气小部件位置调整 */
.weather-widget {
    right: 270px; /* 默认状态：右侧边栏展开 */
    transition: right 0.3s ease;
}

/* 当右侧边栏缩进时 */
body.right-sidebar-collapsed .weather-widget {
    right: 70px;
}

/* 移动端侧边栏显示时的天气小部件调整 */
@media (max-width: 1200px) {
    .right-sidebar-visible .weather-widget {
        right: 270px; /* 右侧边栏显示时避开重叠 */
        transition: right 0.3s ease;
    }
}

/* 侧边栏切换按钮 */
.sidebar-toggle {
    display: none;
    font-size: 18px;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

/* 侧边栏缩进按钮 */
.sidebar-collapse-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 101;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 12px 8px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.sidebar-collapse-btn.left {
    left: 250px;
    border-radius: 0 8px 8px 0;
}

.sidebar-collapse-btn.right {
    right: 250px;
    border-radius: 8px 0 0 8px;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
}

/* 缩进状态下的按钮位置 */
body.left-sidebar-collapsed .sidebar-collapse-btn.left {
    left: 50px;
}

body.right-sidebar-collapsed .sidebar-collapse-btn.right {
    right: 50px;
}

/* 缩进按钮悬停效果 */
.sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.05);
}

/* 缩进按钮图标旋转 */
body.left-sidebar-collapsed .sidebar-collapse-btn.left {
    transform: translateY(-50%) rotate(180deg);
}

body.right-sidebar-collapsed .sidebar-collapse-btn.right {
    transform: translateY(-50%) rotate(180deg);
}

body.left-sidebar-collapsed .sidebar-collapse-btn.left:hover {
    transform: translateY(-50%) rotate(180deg) scale(1.05);
}

body.right-sidebar-collapsed .sidebar-collapse-btn.right:hover {
    transform: translateY(-50%) rotate(180deg) scale(1.05);
}

/* 学术工具样式 */
.academic-tools {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.academic-tool-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.academic-tool-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.academic-tool-card .tool-icon {
    font-size: 16px;
    margin-bottom: 4px;
}

.academic-tool-card .tool-name {
    font-size: 10px;
    color: #fff;
    font-weight: 500;
}

/* 学习资源样式 */
.learning-section {
    margin: 30px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.learning-section h2 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
}

.learning-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.learning-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.learning-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.learning-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.learning-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 5px;
}

.learning-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

/* 开发工具样式 */
.dev-tools-section {
    margin: 30px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dev-tools-section h2 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
}

.dev-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.dev-tool-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.dev-tool-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.dev-tool-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.dev-tool-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 5px;
}

.dev-tool-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

/* 生产力工具样式 */
.productivity-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin: 25px 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.productivity-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

.productivity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.productivity-card {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
}

.productivity-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.9);
}

.productivity-card .productivity-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.productivity-card .productivity-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.productivity-card .productivity-desc {
    font-size: 0.9rem;
    color: #666;
}

/* 响应式设计 - 网页标题 */
@media (max-width: 768px) {
    .page-title h1 {
        font-size: 2rem;
        letter-spacing: 1px;
    }
    
    .page-title h1::after {
        width: 80px;
        height: 2px;
    }
}

@media (max-width: 480px) {
    .page-title h1 {
        font-size: 1.5rem;
        letter-spacing: 0.5px;
    }
    
    .page-title h1::after {
        width: 60px;
    }
    
    .page-title {
        margin-bottom: 20px;
        padding: 15px 0;
    }
}